﻿/*======================================================================================
	TASK 8:                                                     {Conditional Statements}
	Write a program that, depending on the user s choice inputs int, double or string 
    variable. If the variable is integer or double, increases it with 1. If the variable 
    is string, appends "*" at its end. The program must show the value of that variable 
    as a console output. Use switch statement. 
======================================================================================*/

using System;

class Program
{
    static void Main()
    {
        Console.Write("Enter somting stupid user:");
        string str = Console.ReadLine();

        double doubleVar;
        bool counterDouble=double.TryParse(str, out doubleVar);

        //=================  FIRST SOLUTION  =============================//
        switch (counterDouble)
        {
            case true:
                Console.WriteLine("your number is already:{0}", doubleVar+1);
                break;
            case false:
                
                Console.WriteLine("{0}{1}", str, '*');
                break;
        }

        //=================  SECOND SOLUTION  =============================//
        //sbyte counter;

        //if (int.TryParse(str, out integerVar) )
        //{
        //    integerVar = integerVar + 1;
        //    counter=0;
        //}
        //else if (double.TryParse(str, out doubleVar))
        //{
        //    doubleVar = doubleVar + 1;
        //    counter=1;
        //}
        //else
        //{
        //    counter=2;
        //}

        //switch (counter)
        //{
        //    case 0:
        //        Console.WriteLine("You entered integer number==>your number is already:{0}",integerVar);
        //        break;
        //    case 1:
        //        Console.WriteLine("You entered double number==>your number is already:{0}", doubleVar);
        //        break;
        //    case 2:
        //        Console.WriteLine("{0}{1}",str,'*');
        //        break;
        //    default:
        //        break;
        //}
    }
}

